<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr = [
            {
                name:"美人鱼",
                singer:"林俊杰"
            },
            {
                name:"安静",
                singer:"周杰伦"
            },
            {
                name:"听妈妈的话",
                singer:"周杰伦"
            },
            {
                name:"男孩",
                singer:"梁博"
            }
        ]

        // find的回调函数
        // 1. 第一个参数 循环当前的对象本身
        // 2. 第二个参数 循环当前的下标
        // 3. 被循环的数组本身
        let obj = arr.find(function(item,index,arr){
            // console.log(item,index,arr);
            return item.name === "美人鱼";
        })

        console.log(obj); //{name: '美人鱼', singer: '林俊杰'}
        

       


    </script>
</body>
</html>